package com.hxzy.service.impl;

import com.alibaba.fescar.spring.annotation.GlobalTransactional;
import com.hxzy.mapper.BrandMapper;
import com.hxzy.pojo.Brand;
import com.hxzy.service.BrandService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class BrandServiceImpl implements BrandService {
    @Autowired
    private BrandMapper brandMapper;

    public List<Brand> findAllBrand() {
        List<Brand> brands = brandMapper.selectList(null);
        return brands;
    }
    @GlobalTransactional(name = "my_test_tx_group")
    public int addBrand(Brand brand) {
        int insert = brandMapper.insert(brand);
        return insert;
    }
}
